<template>
  <div class="app-container">
    <template>
      <div class="hidden-md-and-up">
        <el-alert title="如若不适应手机端操作，建议使用电脑操作" type="warning" />
      </div>
    </template>
    <div class="table-container">
      <div style="padding-bottom:20px; display: flex;">
        <el-button type="primary" size="medium" plain @click="addthesis">参加会议录入</el-button>
        <div style="width: 200px; margin-left: 20px;">
          <el-input v-model="search" size="medium" placeholder="输入关键字搜索" />
        </div>
      </div>
      <el-table
        v-loading="paperListLoading"
        :data="paperList"
        element-loading-text="Loading"
        border
        fit
      >
        <el-table-column type="selection" align="center" width="55" />
        <!-- <el-table-column align="center" label="序号" width="55">
          <template slot-scope="scope">
            {{ scope.$index+1 }}
          </template>
        </el-table-column> -->
        <el-table-column align="center" label="会议名称" min-width="120">
          <template slot-scope="scope">
            {{ scope.row.meetingname }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="参会地址" min-width="100">
          <template slot-scope="scope">
            {{ scope.row.meetingplace }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="会议类型" min-width="100">
          <template slot-scope="scope">
            {{ scope.row.meetingcate }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="主办单位" min-width="100">
          <template slot-scope="scope">
            {{ scope.row.hostunit }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="录入日期" min-width="100">
          <template slot-scope="scope">
            {{ scope.row.entereddate }}
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          label="状态"
          :filters="[{ text: '草稿', value: '草稿' }, { text: '待院审核', value: '待院审核' }, { text: '被院级退回', value: '被院级退回' }, { text: '待校审核', value: '待校审核' }, { text: '被校级退回', value: '被校级退回' }, { text: '审核通过', value: '审核通过' }]"
          :filter-method="filterTag"
          filter-placement="bottom-end"
          min-width="120"
        >
          <template slot-scope="scope">
            <el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
            <el-tag v-if="scope.row.status === '被院级退回' | scope.row.status === '被校级退回'" type="warning">{{ scope.row.reason }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作" width="230">
          <template slot-scope="scope">
            <el-popover
              :ref="`popoverdelete-${scope.$index}`"
              placement="top"
              width="160"
            >
              <p>确认删除本行吗？该操作不可撤销</p>
              <div style="text-align: right; margin: 0">
                <el-button size="mini" type="text" @click="scope._self.$refs[`popoverdelete-${scope.$index}`].doClose()">取消</el-button>
                <el-button type="primary" size="mini" @click="delete_thesis(scope.$index, scope.row)">确定</el-button>
              </div>
            </el-popover>
            <el-popover
              :ref="`popovercommit-${scope.$index}`"
              placement="top"
              width="160"
            >
              <p>确认提交吗？提交后不可再修改</p>
              <div style="text-align: right; margin: 0">
                <el-button size="mini" type="text" @click="scope._self.$refs[`popovercommit-${scope.$index}`].doClose()">取消</el-button>
                <el-button type="primary" size="mini" @click="commit_thesis(scope.$index, scope.row)">确定</el-button>
              </div>
            </el-popover>
            <el-button
              size="mini"
              @click="open_infoview_dialog(scope.row)"
            >
              编辑
            </el-button>
            <el-button
              v-popover="`popoverdelete-${scope.$index}`"
              size="mini"
              type="danger"
            >
              删除
            </el-button>
            <el-button
              v-popover="`popovercommit-${scope.$index}`"
              size="mini"
              type="success"
            >
              提交
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="block">
        <el-pagination
          background
          :current-page="p1_page"
          :page-sizes="[1,2,3,10, 20, 30, 40]"
          :page-size="p1_size"
          layout="total, sizes, prev, pager, next, jumper"
          :total="p1_total"
          @size-change="p1_sizechange"
          @current-change="p1_currentchange"
        />
        <!-- @size-change="handleSizeChange"
          @current-change="handleCurrentChange" -->
        <!-- 使用了size-change和current-change事件来处理页码大小和当前页变动时候触发的事件。 -->
      </div>
      <el-dialog title="参加会议录入" :visible.sync="thesis_add_dialog" width="75%">
        <el-form ref="thesis_add_form1" :model="thesis_add_form1" label-position="top" label-width="160px" autocomplete="off">
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="录入人" prop="entered">
                <el-input v-model="thesis_add_form1.entered" :disabled="true" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="会议名称" prop="meetingname">
                <el-input v-model="thesis_add_form1.meetingname" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="会议类型" prop="meetingcate">
                <el-input v-model="thesis_add_form1.meetingcate" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="参会地址" prop="meetingplace">
                <el-input v-model="thesis_add_form1.meetingplace" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="会议主题内容" prop="meetingtheme">
                <el-input v-model="thesis_add_form1.meetingtheme" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="参会人" prop="participants">
                <el-input v-model="thesis_add_form1.participants" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="主办单位" prop="hostunit">
                <el-input v-model="thesis_add_form1.hostunit" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="会议开始日期" prop="startTime">
                <el-date-picker
                  v-model="thesis_add_form1.startTime"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd  HH:mm:ss"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="会议结束日期" prop="endTime">
                <el-date-picker
                  v-model="thesis_add_form1.endTime"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd  HH:mm:ss"
                />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="论文题目" prop="papernames">
                <el-input v-model="thesis_add_form1.papernames" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="提交论文数量" prop="papernum">
                <el-input v-model="thesis_add_form1.papernum" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="报告题目" prop="reportnames">
                <el-input v-model="thesis_add_form1.reportnames" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="报告信息" prop="reportmessage">
                <el-input v-model="thesis_add_form1.reportmessage" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="提交报告数量" prop="reportnum">
                <el-input v-model="thesis_add_form1.reportnum" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="获奖信息" prop="awardmessage">
                <el-input v-model="thesis_add_form1.awardmessage" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="经费实际支出(万元)" prop="fundsoutput">
                <el-input v-model="thesis_add_form1.fundsoutput" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="提供经费数量(万元)" prop="fundssup">
                <el-input v-model="thesis_add_form1.fundssup" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="经费来源" prop="fundsorigin">
                <el-input v-model="thesis_add_form1.fundsorigin" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="所属院系" prop="dept">
                <el-input v-model="thesis_add_form1.dept" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="统计分类" prop="classifi">
                <el-input v-model="thesis_add_form1.classifi" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="学科分类" prop="disciplineclassifi">
                <el-input v-model="thesis_add_form1.disciplineclassifi" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
            <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
              <br>
            </el-col>
            <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
              <el-form-item label="备注" prop="notes">
                <el-input v-model="thesis_add_form1.notes" style="min-width: 270px;" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-popover
            ref="dialog1"
            v-model="visible1"
            placement="top"
            width="160"
          >
            <p>关闭后，已填写的内容会丢失，建议保存为草稿，确定要关闭吗？</p>
            <div style="text-align: right; margin: 0">
              <el-button size="mini" type="text" @click="visible1 = false">取消</el-button>
              <el-button type="primary" size="mini" @click="visible1 = false;thesis_add_dialog = false;">确定</el-button>
            </div>
          </el-popover>
          <el-button v-popover:dialog1>关 闭</el-button>
          <el-button type="primary" @click="save_add_form1(thesis_add_form1)">保 存</el-button>
        </div>
      </el-dialog>
      <el-dialog title="编辑信息" :visible.sync="infoview_dialog" width="75%">
        <el-collapse v-model="activeNames">
          <el-collapse-item name="1">
            <template slot="title">
              <div class="el-descriptions__title">参加会议信息</div>
            </template>
            <el-dialog title="参加会议信息" :visible.sync="thesis_info_dialog" width="60%" append-to-body>
              <el-form :model="thesis_add_form2" label-position="top" label-width="160px" autocomplete="off">
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="录入人" prop="entered">
                      <el-input v-model="thesis_add_form2.entered" :disabled="true" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="会议名称" prop="meetingname">
                      <el-input v-model="thesis_add_form2.meetingname" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="会议类型" prop="meetingcate">
                      <el-input v-model="thesis_add_form2.meetingcate" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="参会地址" prop="meetingplace">
                      <el-input v-model="thesis_add_form2.meetingplace" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="会议主题内容" prop="meetingtheme">
                      <el-input v-model="thesis_add_form2.meetingtheme" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="参会人" prop="participants">
                      <el-input v-model="thesis_add_form2.participants" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="主办单位" prop="hostunit">
                      <el-input v-model="thesis_add_form2.hostunit" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="会议开始日期" prop="startTime">
                      <el-date-picker
                        v-model="thesis_add_form2.startTime"
                        type="datetime"
                        placeholder="选择日期"
                        value-format="yyyy-MM-dd  HH:mm:ss"
                      />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="会议结束日期" prop="endTime">
                      <el-date-picker
                        v-model="thesis_add_form2.endTime"
                        type="datetime"
                        placeholder="选择日期"
                        value-format="yyyy-MM-dd  HH:mm:ss"
                      />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="论文题目" prop="papernames">
                      <el-input v-model="thesis_add_form2.papernames" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="提交论文数量" prop="papernum">
                      <el-input v-model="thesis_add_form2.papernum" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="报告题目" prop="reportnames">
                      <el-input v-model="thesis_add_form2.reportnames" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="报告信息" prop="reportmessage">
                      <el-input v-model="thesis_add_form2.reportmessage" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="提交报告数量" prop="reportnum">
                      <el-input v-model="thesis_add_form2.reportnum" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="获奖信息" prop="awardmessage">
                      <el-input v-model="thesis_add_form2.awardmessage" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="经费实际支出(万元)" prop="fundsoutput">
                      <el-input v-model="thesis_add_form2.fundsoutput" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="提供经费数量(万元)" prop="fundssup">
                      <el-input v-model="thesis_add_form2.fundssup" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="经费来源" prop="fundsorigin">
                      <el-input v-model="thesis_add_form2.fundsorigin" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="所属院系" prop="dept">
                      <el-input v-model="thesis_add_form2.dept" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="统计分类" prop="classifi">
                      <el-input v-model="thesis_add_form2.classifi" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="学科分类" prop="disciplineclassifi">
                      <el-input v-model="thesis_add_form2.disciplineclassifi" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="1" :sm="1" :md="2" :lg="2" :xl="2">
                    <br>
                  </el-col>
                  <el-col :xs="20" :sm="20" :md="10" :lg="10" :xl="8">
                    <el-form-item label="备注" prop="notes">
                      <el-input v-model="thesis_add_form2.notes" style="min-width: 270px;" />
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-popover
                  ref="dialog2"
                  v-model="visible2"
                  placement="top"
                  width="160"
                >
                  <p>关闭后，已填写的内容会丢失，建议保存为草稿，确定要关闭吗？</p>
                  <div style="text-align: right; margin: 0">
                    <el-button size="mini" type="text" @click="visible2 = false">取消</el-button>
                    <el-button type="primary" size="mini" @click="visible2 = false;thesis_info_dialog = false;">确定</el-button>
                  </div>
                </el-popover>
                <el-button v-popover:dialog2>关 闭</el-button>
                <el-button type="primary" @click="save_add_form2(thesis_add_form2)">保 存</el-button>
              </div>
            </el-dialog>
            <div style="padding-bottom:20px; display: flex;">
              <el-button type="primary" size="medium" plain @click="open_thesis_info_dialog(infoview1)">编辑信息</el-button>
            </div>
            <el-descriptions :column="2" size="medium" border :label-style="{width:'25%'}" :content-style="{width:'25%'}">
              <el-descriptions-item label="参加会议ID">
                {{ infoview1.joinMeetingID }}
              </el-descriptions-item>
              <el-descriptions-item label="录入人">
                {{ infoview1.entered }}
              </el-descriptions-item>
              <el-descriptions-item label="录入日期">
                {{ infoview1.entereddate }}
              </el-descriptions-item>
              <el-descriptions-item label="会议名称">
                {{ infoview1.meetingname }}
              </el-descriptions-item>
              <el-descriptions-item label="参会地址">
                {{ infoview1.meetingplace }}
              </el-descriptions-item>
              <el-descriptions-item label="会议类型">
                {{ infoview1.meetingcate }}
              </el-descriptions-item>
              <el-descriptions-item label="会议主题内容">
                {{ infoview1.meetingtheme }}
              </el-descriptions-item>
              <el-descriptions-item label="参会人">
                {{ infoview1.participants }}
              </el-descriptions-item>
              <el-descriptions-item label="主办单位">
                {{ infoview1.hostunit }}
              </el-descriptions-item>
              <el-descriptions-item label="会议开始日期">
                {{ infoview1.startTime }}
              </el-descriptions-item>
              <el-descriptions-item label="会议结束日期">
                {{ infoview1.endTime }}
              </el-descriptions-item>
              <el-descriptions-item label="论文题目">
                {{ infoview1.papernames }}
              </el-descriptions-item>
              <el-descriptions-item label="提交论文数量">
                {{ infoview1.papernum }}
              </el-descriptions-item>
              <el-descriptions-item label="报告题目">
                {{ infoview1.reportnames }}
              </el-descriptions-item>
              <el-descriptions-item label="报告信息">
                {{ infoview1.reportmessage }}
              </el-descriptions-item>
              <el-descriptions-item label="提交报告数量">
                {{ infoview1.reportnum }}
              </el-descriptions-item>
              <el-descriptions-item label="获奖信息">
                {{ infoview1.awardmessage }}
              </el-descriptions-item>
              <el-descriptions-item label="经费实际支出(万元)">
                {{ infoview1.fundsoutput }}
              </el-descriptions-item>
              <el-descriptions-item label="提供经费数量(万元)">
                {{ infoview1.fundssup }}
              </el-descriptions-item>
              <el-descriptions-item label="经费来源">
                {{ infoview1.fundsorigin }}
              </el-descriptions-item>
              <el-descriptions-item label="所属院系">
                {{ infoview1.dept }}
              </el-descriptions-item>
              <el-descriptions-item label="统计分类">
                {{ infoview1.classifi }}
              </el-descriptions-item>
              <el-descriptions-item label="学科分类">
                {{ infoview1.disciplineclassifi }}
              </el-descriptions-item>
              <el-descriptions-item label="审批状态">
                <el-tag :type="infoview1.status | statusFilter">{{ infoview1.status }}</el-tag>
              </el-descriptions-item>
              <el-descriptions-item label="未通过原因">
                {{ infoview1.reason }}
              </el-descriptions-item>
              <el-descriptions-item label="备注">
                {{ infoview1.notes }}
              </el-descriptions-item>
            </el-descriptions>
          </el-collapse-item>
        </el-collapse>
        <div slot="footer" class="dialog-footer">
          <el-button @click="infoview_dialog = false">关 闭</el-button>
        </div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import { getMyPaperList, thesis_add, thesis_add2, thesis_delete, thesis_commit } from '@/api/attend_meetings'
import { Message } from 'element-ui'
import { mapGetters } from 'vuex'

export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        草稿: 'info',
        待院审核: '',
        被院级退回: 'danger',
        待校审核: '',
        被校级退回: 'danger',
        审核通过: 'success'
      }
      return statusMap[status]
    }
  },
  data() {
    return {
      search: '',
      thesis_add_dialog: false,
      thesis_info_dialog: false,
      infoview_dialog: false,
      visible1: false,
      visible2: false,
      thesis_add_form1: {
        annex: '',
        awardmessage: '',
        classifi: '',
        dept: '',
        disciplineclassifi: '',
        endTime: '',
        entered: '',
        entereddate: '',
        fundsorigin: '',
        fundsoutput: '',
        fundssup: '',
        hostunit: '',
        joinMeetingID: '',
        meetingcate: '',
        meetingname: '',
        meetingplace: '',
        meetingtheme: '',
        notes: '',
        papernames: '',
        papernum: '',
        participants: '',
        reason: '',
        reportmessage: '',
        reportnames: '',
        reportnum: '',
        startTime: '',
        status: ''
      },
      thesis_add_form2: {
        annex: '',
        awardmessage: '',
        classifi: '',
        dept: '',
        disciplineclassifi: '',
        endTime: '',
        entered: '',
        entereddate: '',
        fundsorigin: '',
        fundsoutput: '',
        fundssup: '',
        hostunit: '',
        joinMeetingID: '',
        meetingcate: '',
        meetingname: '',
        meetingplace: '',
        meetingtheme: '',
        notes: '',
        papernames: '',
        papernum: '',
        participants: '',
        reason: '',
        reportmessage: '',
        reportnames: '',
        reportnum: '',
        startTime: '',
        status: ''
      },
      paperList: null,
      paperListLoading: false,
      p1_size: 10,
      p1_total: 0,
      p1_page: 1,
      infoview1: {
        annex: '',
        awardmessage: '',
        classifi: '',
        dept: '',
        disciplineclassifi: '',
        endTime: '',
        entered: '',
        entereddate: '',
        fundsorigin: '',
        fundsoutput: '',
        fundssup: '',
        hostunit: '',
        joinMeetingID: '',
        meetingcate: '',
        meetingname: '',
        meetingplace: '',
        meetingtheme: '',
        notes: '',
        papernames: '',
        papernum: '',
        participants: '',
        reason: '',
        reportmessage: '',
        reportnames: '',
        reportnum: '',
        startTime: '',
        status: ''
      },
      activeNames: ['1']
    }
  },
  computed: {
    ...mapGetters([
      'uid',
      'roles',
      'name'
    ]),
    MyPaperPost() {
      return {
        name: this.name,
        pageNum: this.p1_page,
        pageSize: this.p1_size,
        search: this.search
      }
    }
  },
  watch: {
    search() {
      this.paperListLoading = true
      clearTimeout(this.searchTimeout) // 清除之前的定时器
      this.searchTimeout = setTimeout(() => {
        this.fetchPaperData()
        this.paperListLoading = false
      }, 1500) // 设置新的定时器，3秒后执行查询
    }
  },
  created() {
    this.fetchPaperData()
  },
  methods: {
    fetchPaperData() {
      this.paperListLoading = true
      getMyPaperList(this.MyPaperPost).then(response => {
        if (response.code === 200) {
          this.paperList = response.data.list
          this.p1_total = response.data.total
          this.paperListLoading = false
        }
      })
    },
    p1_sizechange(newsize) {
      this.p1_size = newsize
      this.p1_page = 1
      this.fetchPaperData()
    },
    p1_currentchange(newpage) {
      this.p1_page = newpage
      this.fetchPaperData()
    },
    filterTag(value, row) {
      return row.status === value
    },
    resetForm(formName) {
      if (this.$refs[formName] !== undefined) {
        this.$refs[formName].resetFields()
      }
    },
    addthesis() {
      this.thesis_add_dialog = true
      this.resetForm('thesis_add_form1')
      this.thesis_add_form1.entered = this.name
    },
    save_add_form1(formdata) {
      console.log(formdata)
      thesis_add(formdata).then(response => {
        if (response.code === 200) {
          Message.success('保存成功')
          this.thesis_add_dialog = false
          this.fetchPaperData()
        }
      })
    },
    open_thesis_info_dialog(data) {
      this.thesis_info_dialog = true
      this.resetForm('thesis_add_form2')
      this.thesis_add_form2 = JSON.parse(JSON.stringify(data))
    },
    save_add_form2(formdata) {
      thesis_add2(formdata).then(response => {
        if (response.code === 200) {
          Message.success('保存成功')
          this.thesis_info_dialog = false
          this.fetchPaperData()
          this.infoview1 = formdata
        }
      })
    },
    delete_thesis(index, row) {
      this.$refs[`popoverdelete-${index}`].doClose()
      thesis_delete(row.joinMeetingID).then(response => {
        if (response.code === 200) {
          Message.success('删除成功')
          this.fetchPaperData()
        }
      })
    },
    commit_thesis(index, row) {
      this.$refs[`popovercommit-${index}`].doClose()
      thesis_commit(row.joinMeetingID).then(response => {
        if (response.code === 200) {
          Message.success('提交成功')
          this.fetchPaperData()
        }
      })
    },
    open_infoview_dialog(row) {
      this.infoview_dialog = true
      this.infoview1 = JSON.parse(JSON.stringify(row))
    }
  }
}
</script>

<style lang="scss">
.el-form{
  margin-left: 40px;
  .el-input,.el-select{
    width: 300px;
  }
}
.el-tag + .el-tag {
  margin: 10px 10px;
}
.margin-top {
  margin-top: 50px;
}
@media screen and (max-width:600px) {
  .el-dialog{
    width: 100% !important;
  }
  .el-form{
    margin-left: 25px;
  }
}
</style>
